<?php

namespace app\data\controller;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
use app\data\model\DataWarningLog;
/**
 * 异常日志
 * @class WarningLog
 * @package app\data\controller
 */
class WarningLog extends Controller
{
    /**
     * 通信日志
     * @menu true
     * @auth true
     */
    public function index()
    {
        DataWarningLog::mQuery()->layTable(function () {
            $this->title = '设备异常日志查询';
        }, function (QueryHelper $query) {
            // 数据列表搜索过滤
            $query->alias('l')->field('l.*,d.deviceName,d.nickname,m.mobile');
            $query->join('data_device d','d.iotId  = l.iot_id');
            $query->leftjoin('data_member m','m.id  = d.member_id');
            $query->like('mobile,code,deviceName');
            $query->dateBetween('l.create_at#create_at');
        });
    }

}
